<!--  -->
<template>
	<div>123</div>
</template>

<script>
export default {
	data() {
		return {
			list: [

				{
					date: '2016-05-01',
					name: 'Tom',
					address: [
						{
							date: '2016-05-03',
							name: 'Tom',
							address: 'No. 189, Grove St, Los Angeles',
						},
						{
							date: '2016-05-02',
							name: 'Tom',
							address: 'No. 189, Grove St, Los Angeles',
						},
						{
							date: '2016-05-04',
							name: 'Tom',
							address: 'No. 189, Grove St, Los Angeles',
						},
						{
							date: '2016-05-01',
							name: 'Tom',
							address: 'No. 189, Grove St, Los Angeles',
						}
					],
				}
			]
		};
	},

	components: {},

	computed: {},

	mounted() {
		this.getList()
	},

	methods: {
		async getList() {
			let asyncFun = []
			this.list.map(item => {
				item.address.forEach(item => {
					console.log(111)
					if(item.name === "Tom"){
						asyncFun.push(this.twoGetList())
					}
				});
			})
			await Promise.all(asyncFun).then(() => {
				console.log(333)
			})
		},
		twoGetList() {
			return new Promise((resolve) => {
				setTimeout(() => {
					console.log(222)
					resolve()
				}, 1000)
			})

		}
	}
}

</script>
<style lang='less' scoped>
</style>